<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<? session_start();?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Code-books</title>
<script src="./js/jquery-1.8.3.min.js"></script>
<script src="js/jsfun_class.js"></script>
<link href="css/style_css.css" type="text/css" rel="stylesheet" />
<style type="text/css">
html{ overflow:hidden;}
#wrap{
}
#login{
	background:url(image/bg1.jpg) no-repeat;
	background-size:100%,100%;
}
#main{
	background-color:#fcfcfc;
}
#title{
	font-size:70px;
	color:#FFF;
	padding-top:80px;
	letter-spacing:5px;
}
#log_form{
	margin-top:80px;
}
#nav01{
	width:100%; height:80px;
	background-color:#3C6;
}
#nav01 lable{
	width:200px; height:80px;
	color:#FFF;
	font-weight:bold;
}
#nav01 ul{
	width:1000px; height:auto;
	list-style:none;
	margin:0; padding:0;
	padding-top:20px;
}
#nav01 li{
	width:100px; height:30px;
	border-radius:5px;
	background-color:#FFF;
	color:#3C6;
	padding-top:5px;
	margin-right:10px;
	float:right;
	cursor:default;
}
#nav01 li:hover{
	background-color:#09F;
	color:#FFF;
}
#addItem_div{
	background-color:#EEE;
	width:100%; height:50px;
	padding-top:20px;
	display:none;
}

</style>
</head>

<body><center>
<div id="wrap" align="center">

<div id="login" align="center" class="module01">

<div id="title" align="center">
Code-books
</div>

<div id="log_form" align="center">
<input type="text" id="username" class="text01" onfocus="this.value='';" value="username" />
<input type="text" id="password" class="text01" onfocus="this.value='';" value="password" />
<input type="button" id="submit" value="log in" class="button01" onclick="ajax_vali()" />
</div>

</div>

<div id="main" align="center" class="module01">
<div id="nav01" align="center">
<ul>
<li id="user" onclick="screenScroll(-1,50)">用户</li>
<li onclick="addItem()">添加</li>
</ul>
</div>

<div id="addItem_div" align="center">
<label>标签:</label><input type="text" name="tag" id="tag_f" class="text04" />
<label>用户名:</label><input type="text" name="un" id="un_f" class="text04" />
<label>密码:</label><input type="text" name="pw" id="pw_f" class="text04" />
<input type="button" value="确定" class="button05" onclick="ajax_add()" /><input type="button" onclick="$('#addItem_div').css('display','none')" value="取消" class="button05" />
</div>

<div id="iframe_div" align="center">
<iframe id="iframe" width=100% frameborder="0" scrolling="auto"></iframe>
</div>

</div>

</div>
</center></body>
<script language="javascript">
var s_width=document.documentElement.clientWidth;
var s_height=document.documentElement.clientHeight;
var username;
$("#wrap").css("width",s_width+'px').css("height",3*s_height+'px');
$(".module01").css("width",s_width+'px').css("height",s_height+'px');

$("#iframe").css('height',s_height-150+'px');
function ajax_vali(){
	var username=document.getElementById('username').value;
	var password=document.getElementById('password').value;
	var url="./console/ajax_vali.php?username="+username+"&password="+password;
	do_ajax(url,1,"screenScroll(1,50)");
	username=$("#username").val();
	
	$("#user").html(username).css("float","left").css("border-radius","1px").css("width","150px");
	document.getElementById('iframe').src="./iframe/iframe_1.php?username="+username;
}
function ajax_add(){
	var tag=$("#tag_f").val();
	var un=$("#un_f").val();
	var pw=$("#pw_f").val();
	var username=$("#username").val();
	var url="./console/ajax_add.php?tag="+tag+"&un=+"+un+"&pw="+pw+"&username="+username;
	if(tag==""||un==""||pw==""){
		alert("信息不全!");
	}else{
		do_ajax(url,1,"disAddDiv()");
	}
}
function addItem(){
	$("#addItem_div").css("display","block");
}
function disAddDiv(){
	$("#addItem_div").css("display","none");
}
</script>
</html>